import { DatePicker, Divider, Form, Table, Typography, type TableColumnsType } from "@/components/base";
import { Controller, MonthEnum } from "@/controller";
import React from "react";
import dayjs from "dayjs";
import * as XLSX from 'xlsx';
import { decorator } from "@/tools/fns/decorator";
import { observer } from "mobx-react";
import { toCurrencyNum } from "@/tools/fns/toCurrency";
import { countCardSwipe } from "@/tools/fns";
import styles from './index.module.less';
import { useLocation } from "react-router-dom";

const { Text } = Typography;

/** 每日总结 */
const DailySummary = decorator(observer)(function () {

    const [form] = Form.useForm();
    const controller = React.useContext(Controller.Context);
    const { data } = controller;
    const [values, setValues] = React.useState<any>({});
    const location = useLocation()

    // 获取地址参数 day
    const day = new URLSearchParams(location.search).get('day');


    /** 月开始时间 */
    const monthStart = React.useMemo(() => {
        if (!values.date) return undefined;
        // 如果 values.date 小于 26日 开始时间是上一个月的26日
        // 如果 values.date 大于等于 26日 开始时间是本月的26日
        const date: dayjs.Dayjs = values.date;
        return date.date() < 26 ? date.subtract(1, 'month').date(25) : date.date(25);
    }, [values.date]);

    /** 得到所有护理师 */
    const nursesList = React.useCallback(() => {
        // 使用 Set 去重后再转回数组
        return [...new Set(data.target?.map(e => e['护理师']) || [])];
    }, [data])

    /** 月达成-客次/新客/人 */
    const monthlyTargetCustomerVisits = React.useCallback(() => {
        const turnover = data.turnover
            ?.filter(e => {
                const date: dayjs.Dayjs = values.date;
                const ed = dayjs(XLSX.SSF.format("yyyy-mm-dd", e['日期']))

                // ed 时间 小于等于 monthStart 的  大于等于 date
                return ed.isSameOrBefore(date) && ed.isSameOrAfter(monthStart);
            })
            ?.filter(e => {
                return e['客户类型'] === '新客';
            })

        const map = new Map();
        turnover?.forEach(e => {
            const key = e['客户名称'] + e['日期'];
            if (!map.has(key)) {
                map.set(key, 1);
            } else {
                map.set(key, map.get(key) + 1);
            }
        });

        return map.size || 0;
    }, [data.turnover, monthStart, values.date])

    /** 月达目标-客次/新客/人 */
    const monthlyTargetCustomerVisitsPerPerson = React.useCallback(() => {
        const date: dayjs.Dayjs = values.date;
        const target = data.target?.filter(e => {
            return date.month() === MonthEnum[e['月份']];
        })

        return target?.reduce((acc, cur) => acc + (cur['客次_人'] || 0), 0) || 0;
    }, [data, values])

    /** 当天达成-客次/新客/人 */
    const dailyAchievementCustomerVisits = React.useCallback(() => {
        const turnover = data.turnover
            ?.filter(e => {
                const date: dayjs.Dayjs = values.date;
                const ed = dayjs(XLSX.SSF.format("yyyy-mm-dd", e['日期']))
                return ed.isSame(date, 'day');
            })
            ?.filter(e => {
                return e['客户类型'] === '新客';
            })

        const map = new Map();
        turnover?.forEach(e => {
            const key = e['客户名称'];
            if (!map.has(key)) {
                map.set(key, 1);
            } else {
                map.set(key, map.get(key) + 1);
            }
        });

        return map.size || 0;
    }, [data, values])

    /** 月达成率-客次/新客/人 */
    const monthlyTargetCustomerVisitsRate = React.useCallback(() => {
        const monthlyTarget = monthlyTargetCustomerVisitsPerPerson();
        const monthlyAchievement = monthlyTargetCustomerVisits();

        return monthlyTarget ? (monthlyAchievement / monthlyTarget * 100).toFixed(2) + '%' : '0%';
    }, [monthlyTargetCustomerVisits, monthlyTargetCustomerVisitsPerPerson])

    /** 月目标-成交/人 */
    const monthlyTargetTransactionPerPerson = React.useCallback(() => {
        const date: dayjs.Dayjs = values.date;
        const target = data.target?.filter(e => {
            return date.month() === MonthEnum[e['月份']];
        })

        return target?.reduce((acc, cur) => acc + (cur['成交_人'] || 0), 0) || 0;
    }, [data, values])

    /** 月达成-成交/人 */
    const monthlyAchievementTransactionPerPerson = React.useCallback(() => {
        const equity = data.equity
            ?.filter(e => {
                const date: dayjs.Dayjs = values.date;
                const ed = dayjs(XLSX.SSF.format("yyyy-mm-dd", e['日期']))

                // ed 时间 小于等于 monthStart 的  大于等于 date
                return ed.isSameOrBefore(date) && ed.isSameOrAfter(monthStart);
            })
            ?.filter(e => {
                return e['权益金类型'] === '续卡金额' || e['权益金类型'] === '开卡金额';
            })

        /** 统计客户名称-同一天算一次 */
        const map = new Map();
        equity?.forEach(e => {
            const key = e['客户姓名'] + e['日期'];
            if (!map.has(key)) {
                map.set(key, e['客户姓名'] || 0);
            } else {
                map.set(key, map.get(key) + (e['客户姓名'] || 0));
            }
        });

        return map.size || 0;
    }, [data.equity, monthStart, values.date])

    /**  当天达成-成交/人 */
    const dailyAchievementTransactionPerPerson = React.useCallback(() => {
        const turnover = data.turnover
            ?.filter(e => {
                const date: dayjs.Dayjs = values.date;
                const ed = dayjs(XLSX.SSF.format("yyyy-mm-dd", e['日期']))
                return ed.isSame(date, 'day');
            })
            ?.filter(e => {
                return e['权益金类型'] === '续卡金额' || e['权益金类型'] === '开卡金额';
            })

        const map = new Map();
        turnover?.forEach(e => {
            const key = e['客户姓名'];
            if (!map.has(key)) {
                map.set(key, e['客户姓名'] || 0);
            } else {
                map.set(key, map.get(key) + (e['客户姓名'] || 0));
            }
        });

        return map.size || 0;
    }, [data, values])

    /** 月达成率-成交/人 */
    const monthlyTargetTransactionPerPersonRate = React.useCallback(() => {
        const monthlyTarget = monthlyTargetTransactionPerPerson();
        const monthlyAchievement = monthlyAchievementTransactionPerPerson();

        return monthlyTarget ? (monthlyAchievement / monthlyTarget * 100).toFixed(2) + '%' : '0%';
    }, [monthlyAchievementTransactionPerPerson, monthlyTargetTransactionPerPerson])

    /** 月目标-权益金 */
    const monthlyTargetEquity = React.useCallback(() => {
        const date: dayjs.Dayjs = values.date;
        const target = data.target?.filter(e => {
            return date.month() === MonthEnum[e['月份']];
        })

        return target?.reduce((acc, cur) => acc + (cur['售卡'] || 0) + (cur['外卖'] || 0), 0) || 0;
    }, [data, values])

    /** 月达成 - 权益金  */
    const monthlyAchievementEquity = React.useCallback(() => {
        const equity = data.equity
            ?.filter(e => {
                const date: dayjs.Dayjs = values.date;
                const ed = dayjs(XLSX.SSF.format("yyyy-mm-dd", e['日期']))

                // ed 时间 小于等于 monthStart 的  大于等于 date
                return ed.isSameOrBefore(date) && ed.isSameOrAfter(monthStart);
            })

        return equity?.reduce((acc, cur) => acc + (cur['权益金'] || 0), 0) || 0;
    }, [data.equity, monthStart, values.date])

    /** 当天达成 - 权益金  */
    const dailyAchievementEquity = React.useCallback(() => {
        const equity = data.equity
            ?.filter(e => {
                const date: dayjs.Dayjs = values.date;
                const ed = dayjs(XLSX.SSF.format("yyyy-mm-dd", e['日期']))
                return ed.isSame(date, 'day');
            })

        return equity?.reduce((acc, cur) => acc + (cur['权益金'] || 0), 0) || 0;
    }, [data, values])

    /** 月达成率 - 权益金  */
    const monthlyTargetEquityRate = React.useCallback(() => {
        const monthlyTarget = monthlyTargetEquity();
        const monthlyAchievement = monthlyAchievementEquity();

        return monthlyTarget ? (monthlyAchievement / monthlyTarget * 100).toFixed(2) + '%' : '0%';
    }, [monthlyAchievementEquity, monthlyTargetEquity])

    /** 月目标 - 营业额 */
    const monthlyTargetTurnover = React.useCallback(() => {
        const date: dayjs.Dayjs = values.date;
        const target = data.target?.filter(e => {
            return date.month() === MonthEnum[e['月份']];
        })

        return target?.reduce((acc, cur) => acc + (cur['营业额'] || 0), 0) || 0;
    }, [data, values])

    /** 月达成 - 营业额 */
    const monthlyAchievementTurnover = React.useCallback(() => {
        const turnover = data.turnover
            ?.filter(e => {
                const date: dayjs.Dayjs = values.date;
                const ed = dayjs(XLSX.SSF.format("yyyy-mm-dd", e['日期']))

                // ed 时间 小于等于 monthStart 的  大于等于 date
                return ed.isSameOrBefore(date) && ed.isSameOrAfter(monthStart);
            })

        const equity = data.equity
            ?.filter(e => {
                const date: dayjs.Dayjs = values.date;
                const ed = dayjs(XLSX.SSF.format("yyyy-mm-dd", e['日期']))

                // ed 时间 小于等于 monthStart 的  大于等于 date
                return ed.isSameOrBefore(date) && ed.isSameOrAfter(monthStart);
            })
            ?.filter(e => {
                return e['权益金类型'] === '外卖'
            })
        return (turnover?.reduce((acc, cur) => acc + (cur['耗卡金额'] || 0), 0) || 0) +
            (equity?.reduce((acc, cur) => acc + (cur['权益金'] || 0), 0) || 0);
    }, [data.equity, data.turnover, monthStart, values.date])

    /** 当天达成 - 营业额 */
    const dailyAchievementTurnover = React.useCallback(() => {
        const turnover = data.turnover
            ?.filter(e => {
                const date: dayjs.Dayjs = values.date;
                const ed = dayjs(XLSX.SSF.format("yyyy-mm-dd", e['日期']))
                return ed.isSame(date, 'day');
            })

        const equity = data.equity
            ?.filter(e => {
                const date: dayjs.Dayjs = values.date;
                const ed = dayjs(XLSX.SSF.format("yyyy-mm-dd", e['日期']))
                return ed.isSame(date, 'day');
            })
            ?.filter(e => {
                return e['权益金类型'] === '外卖'
            })

        return (turnover?.reduce((acc, cur) => acc + (cur['耗卡金额'] || 0), 0) || 0) +
            (equity?.reduce((acc, cur) => acc + (cur['权益金'] || 0), 0) || 0);
    }, [data, values])

    /**月达成率 - 营业额 */
    const monthlyTargetTurnoverRate = React.useCallback(() => {
        const monthlyTarget = monthlyTargetTurnover();
        const monthlyAchievement = monthlyAchievementTurnover();

        return monthlyTarget ? (monthlyAchievement / monthlyTarget * 100).toFixed(2) + '%' : '0%';
    }, [monthlyAchievementTurnover, monthlyTargetTurnover]);

    /** 员工 - (售卡/划卡)-月目标 */
    const monthlyTargetSellingCard = React.useCallback((nurses: string, t = '售卡') => {
        const date: dayjs.Dayjs = values.date;
        const target = data.target?.filter(e => {
            return e['护理师'] === nurses && date && date.month() === MonthEnum[e['月份']];
        })

        return target?.reduce((acc, cur) => acc + (cur[t] || 0), 0) || 0;
    }, [data, values]);

    /** 员工 - 售卡-已达成 */
    const monthlySellingReached = React.useCallback((nurses: string) => {
        if (!values.date) return 0;

        const equity = data.equity
            ?.filter(e => {
                const date: dayjs.Dayjs = values.date;
                const ed = dayjs(XLSX.SSF.format("yyyy-mm-dd", e['日期']))

                // ed 时间 小于等于 monthStart 的  大于等于 date
                return ed.isSameOrBefore(date) && ed.isSameOrAfter(monthStart);
            })
            ?.filter(e => e['权益金类型'] === '开卡金额' || e['权益金类型'] === '续卡金额')
            ?.filter(e => e['护理师'] === nurses);

        return equity?.reduce((acc, cur) => acc + (cur['权益金'] || 0), 0) || 0;
    }, [data.equity, monthStart, values.date]);

    /** 员工 - 售卡-达成率 */
    const monthlySellingReachedRate = React.useCallback((nurses: string) => {
        const monthlyTarget = monthlyTargetSellingCard(nurses);
        const monthlyAchievement = monthlySellingReached(nurses);

        return monthlyTarget ? (monthlyAchievement / monthlyTarget * 100).toFixed(2) + '%' : '0%';
    }, [monthlySellingReached, monthlyTargetSellingCard]);

    /** 员工 - 售卡-当日达成 */
    const sellingDayReached = React.useCallback((nurses: string) => {
        if (!values.date) return 0;

        const equity = data.equity
            ?.filter(e => {
                const date: dayjs.Dayjs = values.date;
                const ed = dayjs(XLSX.SSF.format("yyyy-mm-dd", e['日期']))
                return ed.isSame(date, 'day');
            })
            ?.filter(e => e['权益金类型'] === '开卡金额' || e['权益金类型'] === '续卡金额')
            ?.filter(e => e['护理师'] === nurses);

        return equity?.reduce((acc, cur) => acc + (cur['权益金'] || 0), 0) || 0;
    }, [data, values]);

    /** 员工 - 划卡-已达成*/
    const purposeReached = React.useCallback((nurses: string) => {
        if (!values.date) return 0;

        const turnover = data.turnover
            ?.filter(e => {
                const date: dayjs.Dayjs = values.date;
                const ed = dayjs(XLSX.SSF.format("yyyy-mm-dd", e['日期']))

                // ed 时间 小于等于 monthStart 的  大于等于 date
                return ed.isSameOrBefore(date) && ed.isSameOrAfter(monthStart);
            })
            ?.filter(e => e['护理师'] === nurses)

        return countCardSwipe(turnover, data.project, data.cardType);
    }, [data.cardType, data.project, data.turnover, monthStart, values.date])

    /** 员工 - 划卡-达成率 */
    const purposeReachedRate = React.useCallback((nurses: string) => {
        const monthlyTarget = monthlyTargetSellingCard(nurses, '划卡');
        const monthlyAchievement = purposeReached(nurses);

        return monthlyTarget ? (monthlyAchievement / monthlyTarget * 100).toFixed(2) + '%' : '0%';
    }, [monthlyTargetSellingCard, purposeReached]);

    /** 员工 - 划卡-当日达成 */
    const purposeDayReached = React.useCallback((nurses: string) => {
        if (!values.date) return 0;

        const turnover = data.turnover
            ?.filter(e => {
                const date: dayjs.Dayjs = values.date;
                const ed = dayjs(XLSX.SSF.format("yyyy-mm-dd", e['日期']))
                return ed.isSame(date, 'day');
            })
            ?.filter(e => e['护理师'] === nurses);

        return countCardSwipe(turnover, data.project, data.cardType);
    }, [data, values]);

    /** 员工 - 外卖-已达成*/
    const takeoutReached = React.useCallback((nurses: string) => {
        if (!values.date) return 0;

        const equity = data.equity
            ?.filter(e => {
                const date: dayjs.Dayjs = values.date;
                const ed = dayjs(XLSX.SSF.format("yyyy-mm-dd", e['日期']))

                // ed 时间 小于等于 monthStart 的  大于等于 date
                return ed.isSameOrBefore(date) && ed.isSameOrAfter(monthStart);
            })
            ?.filter(e => e['权益金类型'] === '外卖')
            ?.filter(e => e['护理师'] === nurses);

        return equity?.reduce((acc, cur) => acc + (cur['权益金'] || 0), 0) || 0;
    }, [data.equity, monthStart, values.date])

    /** 员工 - 外卖-达成率*/
    const takeoutReachedRate = React.useCallback((nurses: string) => {
        const takeoutTarget = monthlyTargetSellingCard(nurses, '外卖');
        const takeoutAchievement = takeoutReached(nurses);

        return takeoutTarget ? (takeoutAchievement / takeoutTarget * 100).toFixed(2) + '%' : '0%';
    }, [monthlyTargetSellingCard, takeoutReached])

    /** 员工 - 外卖-当日达成 */
    const takeoutDayReached = React.useCallback((nurses: string) => {
        if (!values.date) return 0;

        const equity = data.equity
            ?.filter(e => {
                const date: dayjs.Dayjs = values.date;
                const ed = dayjs(XLSX.SSF.format("yyyy-mm-dd", e['日期']))
                return ed.isSame(date, 'day');
            })
            ?.filter(e => e['权益金类型'] === '外卖')
            ?.filter(e => e['护理师'] === nurses);

        return equity?.reduce((acc, cur) => acc + (cur['权益金'] || 0), 0) || 0;
    }, [data, values]);

    const dataSource1 = React.useMemo(() => {
        if (!values.date) return [];

        const arr: any = []

        arr[0] = {
            indicator: '客次/新客/人',
            monthlyTarget: monthlyTargetCustomerVisitsPerPerson(),
            monthlyAchievement: monthlyTargetCustomerVisits(),
            dailyAchievement: dailyAchievementCustomerVisits(),
            monthlyRate: monthlyTargetCustomerVisitsRate(),
        }

        arr[1] = {
            indicator: '成交/人',
            monthlyAchievement: monthlyAchievementTransactionPerPerson(),
            dailyAchievement: dailyAchievementTransactionPerPerson(),
            monthlyTarget: monthlyTargetTransactionPerPerson(),
            monthlyRate: monthlyTargetTransactionPerPersonRate(),
        }

        arr[2] = {
            indicator: '权益金/元',
            monthlyAchievement: monthlyAchievementEquity(),
            dailyAchievement: dailyAchievementEquity(),
            monthlyTarget: monthlyTargetEquity(),
            monthlyRate: monthlyTargetEquityRate(),
        }

        arr[3] = {
            indicator: '营业额/元',
            monthlyAchievement: monthlyAchievementTurnover(),
            dailyAchievement: dailyAchievementTurnover(),
            monthlyTarget: monthlyTargetTurnover(),
            monthlyRate: monthlyTargetTurnoverRate(),
        }

        return arr;
    }, [values.date, monthlyTargetCustomerVisitsPerPerson, monthlyTargetCustomerVisits, dailyAchievementCustomerVisits, monthlyTargetCustomerVisitsRate, monthlyAchievementTransactionPerPerson, dailyAchievementTransactionPerPerson, monthlyTargetTransactionPerPerson, monthlyTargetTransactionPerPersonRate, monthlyAchievementEquity, dailyAchievementEquity, monthlyTargetEquity, monthlyTargetEquityRate, monthlyAchievementTurnover, dailyAchievementTurnover, monthlyTargetTurnover, monthlyTargetTurnoverRate]);

    const dataSource2 = React.useMemo(() => {
        return nursesList().map(e => {
            return {
                nurses: e,
                sellingMonthlyTarget: monthlyTargetSellingCard(e),
                sellingReached: monthlySellingReached(e),
                sellingReachedRate: monthlySellingReachedRate(e),
                sellingDayReached: sellingDayReached(e),

                purposeMonthlyTarget: monthlyTargetSellingCard(e, '划卡'),
                purposeReached: purposeReached(e),
                purposeReachedRate: purposeReachedRate(e),
                purposeDayReached: purposeDayReached(e),

                takeoutMonthlyTarget: monthlyTargetSellingCard(e, '外卖'),
                takeoutReached: takeoutReached(e),
                takeoutReachedRate: takeoutReachedRate(e),
                takeoutDayReached: takeoutDayReached(e),
            }
        });
    }, [monthlySellingReached, monthlySellingReachedRate, monthlyTargetSellingCard, nursesList, purposeDayReached, purposeReached, purposeReachedRate, sellingDayReached, takeoutDayReached, takeoutReached, takeoutReachedRate]);

    React.useEffect(() => {
        form.setFieldsValue({
            date: day ? dayjs(day, 'YYYYMMDD') : dayjs(),
        });
        setValues({
            date: day ? dayjs(day, 'YYYYMMDD') : dayjs(),
        });
    }, [day, form]);

    return (
        <div style={{ padding: 20 }} >
            <Form form={form} layout='inline' onValuesChange={(_, e) => { setValues(e) }} >
                <Form.Item label="日期" name="date">
                    <DatePicker />
                </Form.Item>
            </Form>

            <Divider />

            <div style={{ display: 'flex', gap: 20, flexDirection: 'column' }} >
                <Table bordered dataSource={dataSource1} columns={columns1} size='small' pagination={false} />
                <Table bordered dataSource={dataSource2} columns={columns2} size='small' pagination={false} scroll={{ x: 800 }} />
            </div>
        </div>
    );
})
export default DailySummary;

const columns1: TableColumnsType<any> = [
    {
        title: '类型',
        dataIndex: 'indicator',
        key: 'indicator',
        width: 120,
        align: 'center',
        render: (e) => <Text strong>{e}</Text>,
    },
    {
        title: '月目标',
        dataIndex: 'monthlyTarget',
        key: 'monthlyTarget',
        align: 'center',
        render: (e, r) => {
            return r.indicator.includes('人') ?
                toCurrencyNum(e, '', 0) :
                toCurrencyNum(e, '');
        },
    },
    {
        title: '月达成',
        dataIndex: 'monthlyAchievement',
        key: 'monthlyAchievement',
        align: 'center',
        render: (e, r) => {
            return r.indicator.includes('人') ?
                toCurrencyNum(e, '', 0) :
                toCurrencyNum(e, '');
        },
    },
    {
        title: '月达成率',
        dataIndex: 'monthlyRate',
        key: 'monthlyRate',
        align: 'center',
    },
    {
        title: '当日达成',
        dataIndex: 'dailyAchievement',
        key: 'dailyAchievement',
        align: 'center',
        render: (e, r) => {
            return r.indicator.includes('人') ?
                toCurrencyNum(e, '', 0) :
                toCurrencyNum(e, '');
        },
    },
]

const columns2: TableColumnsType<any> = [
    {
        title: '员工',
        dataIndex: 'nurses',
        key: 'nurses',
        width: 100,
        align: 'center',
        fixed: 'left',
        render: (e) => <Text strong>{e}</Text>,
    },
    {
        title: '售卡',
        className: styles['table-zz'],
        children: [
            {
                title: '月目标(元)',
                dataIndex: 'sellingMonthlyTarget',
                key: 'sellingMonthlyTarget',
                width: 110,
                align: 'center',
                className: styles['table-zz'],
                render: e => toCurrencyNum(e, ''),
            }, {
                title: '已达成(元)',
                dataIndex: 'sellingReached',
                key: 'sellingReached',
                width: 110,
                align: 'center',
                className: styles['table-zz'],
                render: e => toCurrencyNum(e, ''),
            }, {
                title: '达成率',
                dataIndex: 'sellingReachedRate',
                key: 'sellingReachedRate',
                width: 110,
                align: 'center',
                className: styles['table-zz'],
            }, {
                title: '当日达成(元)',
                dataIndex: 'sellingDayReached',
                key: 'sellingDayReached',
                align: 'center',
                width: 110,
                className: styles['table-zz'],
                render: e => toCurrencyNum(e, ''),
            },
        ],
    }, {
        title: '划卡',
        children: [
            {
                title: '月目标(元)',
                dataIndex: 'purposeMonthlyTarget',
                key: 'purposeMonthlyTarget',
                width: 110,
                align: 'center',
                render: e => toCurrencyNum(e, ''),
            }, {
                title: '已达成(元)',
                dataIndex: 'purposeReached',
                key: 'purposeReached',
                width: 110,
                align: 'center',
                render: e => toCurrencyNum(e, ''),
            }, {
                title: '达成率',
                dataIndex: 'purposeReachedRate',
                key: 'purposeReachedRate',
                width: 110,
                align: 'center',
            }, {
                title: '当日达成(元)',
                dataIndex: 'purposeDayReached',
                key: 'purposeDayReached',
                align: 'center',
                width: 110,
                render: e => toCurrencyNum(e, ''),
            },
        ]
    }, {
        title: '外卖',
        className: styles['table-zz'],
        children: [
            {
                title: '月目标(元)',
                dataIndex: 'takeoutMonthlyTarget',
                key: 'takeoutMonthlyTarget',
                width: 110,
                align: 'center',
                className: styles['table-zz'],
                render: e => toCurrencyNum(e, ''),
            }, {
                title: '已达成(元)',
                dataIndex: 'takeoutReached',
                key: 'takeoutReached',
                width: 110,
                align: 'center',
                className: styles['table-zz'],
                render: e => toCurrencyNum(e, ''),
            }, {
                title: '达成率',
                dataIndex: 'takeoutReachedRate',
                key: 'takeoutReachedRate',
                width: 110,
                align: 'center',
                className: styles['table-zz'],
            }, {
                title: '当日达成(元)',
                dataIndex: 'takeoutDayReached',
                key: 'takeoutDayReached',
                align: 'center',
                width: 110,
                className: styles['table-zz'],
                render: e => toCurrencyNum(e, ''),
            },
        ]
    },
]

